import { RouterModule, Routes } from '@angular/router';

import { NgModule } from '@angular/core';
import { AddGoodsComponent } from './pages/add-goods/add-goods.component';
import { FrameComponent } from './pages/frame/frame.component';
import { GoodsComponent } from './pages/goods/goods.component';
import { WelcomeComponent } from './pages/welcome/welcome.component';

const routes: Routes = [
  {
    path: 'welcome',
    component: FrameComponent,
    data: {
      breadcrumb: 'Welcome'
    },
    children: [
      {
        path: '', component: WelcomeComponent
      },
    ],
  },
  {
    path: 'goods',
    component: FrameComponent,
    data: {
      breadcrumb: 'goods'
    },
    children: [
      {
        path: '', component: GoodsComponent
      },
    ],
  },
  {
    path: 'addGoods',
    component: FrameComponent,
    data: {
      breadcrumb: 'addGoods'
    },
    children: [
      {
        path: '', component: AddGoodsComponent
      },
    ],
  },
  {
    path: '',
    pathMatch: 'full',
    redirectTo: 'welcome',
  },
  { path: '**', redirectTo: 'welcome' },
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule { }
